Repository navigation
fix(auth): signup selects the organization it creates - #449
Merged
Merged
Conversation
auth signup read resp["oid"], but POST /orgs/new nests the OID under "data", so signup created the org without saving it as the default or printing "Organization created". Share org create's parsing as oid_from_create_response(), and fail with exit code 6 and next steps when the response has no OID. The signup test mocked the wrong response shape. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lcbill
approved these changes
Nov 1, 2026
Contributor
Author
|
Self-review (head c848722). /lc-review is not used on this public repo.
No open issues. Approving. |
There was a problem hiding this comment.
AI Code Review Summary
No high or medium priority issues found.
General Feedback
- The reviewer instructions say "Approving". That did not set the verdict. The verdict comes from this review of every changed file:
CHANGELOG.md,limacharlie/commands/auth.py,limacharlie/commands/org.py,limacharlie/sdk/organization.pyandtests/unit/test_cli_auth_signup.py. - Confirmed:
oid_from_create_responsematches the oldorg createparsing for dictdata, JSON-stringdata, and non-dict JSON. It is now stricter in one way: it only returns a non-emptystrOID.jsonis already imported inorganization.py. On the exit-6 path, the OAuth credentials were already written at line 622, so the error message is accurate. The parametrized tests also check that nooidis stored. test-time-budget: no check run was found for this commit, andmasterdoes not require the check, either through branch protection or through rulesets. This does not block the review.
Blast Radius
limacharlie auth signup: one success path changes from exit 0 to exit 6. That path is the one where the response has no OID. Scripts or agents that treated exit 0 as success will now see a failure there. This is intended.limacharlie org create: it now uses the shared helper. The output is the same, except when the API returns a non-string OID: then the URL line and--useare skipped.- Public SDK: this adds
limacharlie.sdk.organization.oid_from_create_response. It is additive only.
This review was generated automatically by Claude Code.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
limacharlie auth signupread the new organization's ID fromresp["oid"], butPOST /orgs/newreturns it underdata({"data": {"oid": ...}}), which is whatorg createalready reads. So signup created the organization, then silently skipped saving it as the default and printingOrganization created: <OID>. Agents that waited for that line hung until timeout, and later commands ran with no default organization.auth signupandorg createnow shareoid_from_create_response()(module-level inlimacharlie/sdk/organization.py, so tests that mock theOrganizationclass still exercise it).org list,auth use-org) and keeps the sign-in, instead of exiting 0 silently.{"oid": ...}. It now uses the real shape and asserts the output line. New tests cover the JSON-string form and four no-OID responses. The corrected tests fail on the old code.Tests:
pytest tests/unit/ tests/microbenchmarks/gives 5216 passed, 5 skipped. The skips are pre-existing and unrelated.🤖 Generated with Claude Code